package com.zhsource.utils;

/**
 * @Description: (用于根据一定规则生成 key)
 */
public class RedisKeyUtils {
    /**
     * 保存用户点赞数据的key
     */
    public static final String MAP_KEY_USER_LIKED = "MAP_USER_LIKED";
    /**
     * 保存文章被点赞数量的key
     */
    public static final String MAP_KEY_USER_LIKED_COUNT = "MAP_USER_LIKED_COUNT";
    /**
     * 文章阅读量key
     */
    public static final String MAP_USER_NEWS_READING_QUANTITY = "MAP_USER_NEWS_READING_QUANTITY";
 
    /**
     * 拼接被点赞的文章id和点赞的人的id作为key。格式 222222::333333
     * @param userlike 被点赞的文章id
     * @param uid 点赞的人的id
     * @return
     */
    public static String getLikedKey(Long userlike, Long uid){
        StringBuilder builder = new StringBuilder();
        builder.append(userlike);
        builder.append("::");
        builder.append(uid);
        return builder.toString();
    }
}